package main

// 参数结构体定义
type CreateJobArgs struct {
	JobConfig JobConfig `json:"job_config" jsonschema:"required,description=作业配置信息"`
}

type BuildJobArgs struct {
	JobName    string            `json:"job_name" jsonschema:"required,description=作业名称"`
	Parameters map[string]string `json:"parameters" jsonschema:"description=构建参数"`
	Wait       bool              `json:"wait" jsonschema:"description=是否等待构建完成"`
}

type GetJobInfoArgs struct {
	JobName string `json:"job_name" jsonschema:"required,description=作业名称"`
}

type GetBuildInfoArgs struct {
	JobName     string `json:"job_name" jsonschema:"required,description=作业名称"`
	BuildNumber int    `json:"build_number" jsonschema:"required,description=构建号"`
}

type GetBuildLogArgs struct {
	JobName     string `json:"job_name" jsonschema:"required,description=作业名称"`
	BuildNumber int    `json:"build_number" jsonschema:"required,description=构建号"`
	Start       int    `json:"start" jsonschema:"description=开始行数"`
}

type DeleteJobArgs struct {
	JobName string `json:"job_name" jsonschema:"required,description=作业名称"`
}

type UpdateJobArgs struct {
	JobName   string    `json:"job_name" jsonschema:"required,description=作业名称"`
	JobConfig JobConfig `json:"job_config" jsonschema:"required,description=新的作业配置"`
}

type ListJobsArgs struct {
	Folder string `json:"folder" jsonschema:"description=文件夹路径"`
}

type GetNodeInfoArgs struct {
	NodeName string `json:"node_name" jsonschema:"description=节点名称，为空则获取所有节点"`
}

type CreateCredentialArgs struct {
	CredentialID string                 `json:"credential_id" jsonschema:"required,description=凭据ID"`
	Type         string                 `json:"type" jsonschema:"required,description=凭据类型"`
	Config       map[string]interface{} `json:"config" jsonschema:"required,description=凭据配置"`
}

type GetPluginInfoArgs struct {
	PluginName string `json:"plugin_name" jsonschema:"description=插件名称，为空则获取所有插件"`
}

type InstallPluginArgs struct {
	PluginName string `json:"plugin_name" jsonschema:"required,description=插件名称"`
	Version    string `json:"version" jsonschema:"description=插件版本"`
}

type QueueInfoArgs struct{}

type SystemInfoArgs struct{}

type RestartJenkinsArgs struct {
	SafeRestart bool `json:"safe_restart" jsonschema:"description=是否安全重启"`
}
